package com.example.charstream;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class CharStreamDemo5 {
    public static void main(String[] args) throws IOException {

        /**
         * 字符输入流缓冲区
         */

        FileReader fr = new FileReader("src/com/example/file/b.txt");
        System.out.println(fr.read());

        /**
         * 1.清空文件
         * 2.写入文件
         */
        FileWriter fw = new FileWriter("src/com/example/file/b.txt");

        int read = fr.read();
        System.out.println((char) read);

        fw.close();
        fr.close();

    }
}
